import {createRouter, createWebHistory} from 'vue-router'
import Home from '../components/Hello'
import Index from "../views/Index.vue";
import Editor from "../views/Editor.vue";
import TemplateDetail from "../views/TemplateDetail.vue";
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path:'/',
      name: 'index',
      component: Index,
      meta: {
        title: '首页',
        withHeader:true
      },
      children: [
        { path: '', name: 'home', component: Home, meta: { title: '欢迎来到慕课乐高' } },
        { path: 'template/:id', name: 'template', component: TemplateDetail, meta: { title: '模版详情' } },
        // { path: 'works', name: 'works', component: Works, meta: { title: '我的作品', requiredLogin: true, } }
      ]
    },
    {
      path:'/editor',
      name: 'editor',
      component: Editor,
      meta: {
        title: '编辑器',
        withHeader:true
      },
    },
    // {
    //   path:'/template/:id',
    //   name:'template',
    //   component: TemplateDetail,
    //   meta: {
    //     title: '模版',
    //   },

     
    // }
  ]
})
export default router